package com.junmeng.jdemo.recycler.chat.contextmenu;

import androidx.annotation.IntDef;

import com.junmeng.jdemo.R;

public class MenuInfo {
    public int menuId;
    public int iconResId;
    public int labelResId;

    public MenuInfo() {
    }

    public MenuInfo(int menuId, int iconResId, int labelResId) {
        this.iconResId = iconResId;
        this.labelResId = labelResId;
        this.menuId = menuId;
    }

    @IntDef({MenuId.COPY, MenuId.FORWARD})
    public @interface MenuId {
        int COPY = 1;
        int FORWARD = 2;
    }

    public static MenuInfo createMenuInfo(@MenuId int menuId) {
        switch (menuId) {
            case MenuId.COPY:
                return new MenuInfo(MenuId.COPY, R.mipmap.ic_launcher, R.string.app_name);
            case MenuId.FORWARD:
                return new MenuInfo(MenuId.FORWARD, R.drawable.battery, R.string.hello_blank_fragment);
        }
        return new MenuInfo();
    }

}
